Skip to content

Use ImagingNewDirty() in RankFilter and remove ImagingFill() in font.getmask()#9744

Merged
hugovk merged 2 commits into
python-pillow:mainfrom
akx:dirtier
Jul 4, 2026
Merged

Use ImagingNewDirty() in RankFilter and remove ImagingFill() in font.getmask()#9744
hugovk merged 2 commits into
python-pillow:mainfrom
akx:dirtier

Conversation

@akx

@akx akx commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Tiny performance improvement. The image is always fully filled anyway.

Related #9743's 2nd commit (same pattern).

The image is always zero-filled anyway.
@codspeed-hq

codspeed-hq Bot commented Jun 30, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 345 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing akx:dirtier (d0dbc43) with main (1cf685c)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@radarhere

Copy link
Copy Markdown
Member

I've created akx#8 with a suggestion - in _imaging.c, rather than replacing ImagingNewDirty with ImagingNew, wouldn't it be more efficient to remove the ImagingFill call?

@radarhere radarhere changed the title Use ImagingNewDirty() in font.getmask() and RankFilter Use ImagingNewDirty() in RankFilter and remove ImagingFill() in font.getmask() Jul 3, 2026
@hugovk hugovk merged commit 31dba2d into python-pillow:main Jul 4, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants